import { createApp } from 'vue' //导入createApp
import App from './App.vue' //导入App.vue

import router from './router/router.js' //导入router
import { createPinia } from 'pinia' //导入createPinia

import ElementPlus from 'element-plus' //导入 ElementPlus 组件库的所有模块和功能 
import 'element-plus/dist/index.css' //导入 ElementPlus 组件库所需的全局 CSS 样式
import * as ElementPlusIconsVue from "@element-plus/icons-vue"//导入 ElementPlus 组件库的所有图标

import "./tailwindcss.css"; //导入 Tailwind CSS 样式

//从 pinia-plugin-persistedstate 模块中导入 piniaPluginPersistedstate
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
const pinia = createPinia() //导入pinia实例
//将插件添加到 pinia 实例上
pinia.use(piniaPluginPersistedstate)


const app=createApp(App)               //createApp(App) 创建Vue应用实例

// 自动引入图标
Object.keys(ElementPlusIconsVue).forEach((key) => {
    app.component(key, ElementPlusIconsVue[key]);
  });

app.use(router)                 //use(router) 将Vue Router实例注册到Vue应用中
app.use(pinia)                  //将Pinia实例注册到Vue应用中
app.use(ElementPlus)            //use(ElementPlus) 将ElementPlus实例注册到Vue应用中
app.mount('#app')               //mount('#app') 将Vue实例挂载到id为app的元素上
